﻿@using Microsoft.AspNetCore.Identity;
@inject SignInManager<ApplicationUser> _signInManager;


<nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark">
    <a class="navbar-brand" asp-controller="home" asp-action="index">权限管理系统</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarText">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item active">
                <a class="nav-link" asp-controller="home" asp-action="index">Home <span class="sr-only">(current)</span></a>
            </li>
            <li class="nav-item">
                <a class="nav-link" asp-controller="users" asp-action="index">Users</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">Roles</a>
            </li>
        </ul>
        <ul class="nav justify-content-end">
            @if (_signInManager.IsSignedIn(User))
            {
                <li class="nav-item">
                    <span class="nav-link disabled text-primary">欢迎您,@User.Identity.Name</span>
                </li>
                <li class="nav-item">
                    <a class="nav-link" asp-controller="account" asp-action="SignOutAsync">退出</a>
                </li>
            }
            else
            {
                <li class="nav-item">
                    <a class="nav-link" asp-controller="account" asp-action="SignIn">登录</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" asp-controller="account" asp-action="SignUp">注册</a>
                </li>
            }
        </ul>
    </div>
</nav>



